<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>祈贝健康--后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/animate.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style-responsive.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" />
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="./Public/Admin/assets/plugins/pace/pace.min.js"></script>
    <!-- ================== END BASE JS ================== -->
</head>
<body>
<php> include './Public/Admin/header.html'; </php>
    
    
    
<!-- begin #content -->
		<div id="content" class="content">
			<!-- begin breadcrumb -->
			<ol class="breadcrumb pull-right">
				<li><a href="javascript:;">首页</a></li>
				<li><a href="javascript:;">模块管理</a></li>
				<li class="active">添加模块</li>
                                
			</ol>
			<!-- end breadcrumb -->
			<!-- begin page-header -->
			<h1 class="page-header">模块管理 <small>添加模块</small></h1>
			<!-- end page-header -->
			
			<!-- begin row -->
			<div class="row">
			    <!-- begin col-12 -->
			    <div class="col-md-12">
			        <!-- begin panel -->
                    <div class="panel panel-inverse">
                        <div class="panel-heading">
                            <div class="panel-heading-btn">
                                <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                                <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                                <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                                <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                            </div>
                            <h4 class="panel-title">添加模块</h4>
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive"> 
                                
                                
                                                                  <!--表单--> 
                                    
                                        <div class='col-md-10'>
                                            <form class='form-horizontal' role='form'>
                                            <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>模块名：</label>
                                                <div class='col-md-4'>
                                                    <input type='text' class='form-control input-lg' name="name" id='name' placeholder='请输入文本文字'>
                                                </div>
                                            </div>
                                            <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>是否显示菜单：</label>
                                                <div class='col-md-4'>
                                                    <select class='form-control' name="is_cd" id="is_cd">
                                                        <option value="1">显示</option>
                                                        <option value="0">不显示</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>选择菜单：</label>
                                                <div class='col-md-4'>
                                                    <select class='form-control' name="cd_id" id="cd_id">
                                                        <option value="0">顶级菜单</option>
                                                        
                                                    </select>
                                                </div>
                                            </div>
                                            <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>控制器名：</label>
                                                <div class='col-md-4'>
                                                    <input type='text' class='form-control input-lg' name="controller" id='controller' placeholder='请输入文本文字'>
                                                </div>
                                            </div>
                                                <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>方法名：</label>
                                                <div class='col-md-4'>
                                                    <input type='text' class='form-control input-lg' name="function" id='function' placeholder='请输入文本文字'>
                                                </div>
                                            </div>
                                            
                                            <div class='form-group'>
                                                <label for='inputtext' class='col-md-2 control-label'>bootstrap图标：</label>
                                                <div class='col-md-4'>
                                                    <input type='text' class='form-control input-lg' name="ico" id='ico' placeholder='请输入文本文字'>
                                                </div>
                                            </div>
                                            <div class='form-group'>
                                                <div class='col-md-3 col-md-offset-2'>
                                                    <a onclick="fromes()" class='btn btn-success btn-radius form-control'>提交</a>
                                                </div>
                                            </div>
                                            </form>
                                        </div>
                                    
                                
                            </div>
                        </div>
                    </div>
                    <!-- end panel -->
                </div>
                <!-- end col-12 -->
            </div>
            <!-- end row -->
		</div>
		<!-- end #content -->


<!-- begin scroll to top btn -->
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
<!-- end scroll to top btn -->
<?php include './header.html'; ?>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="./Public/Admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="./Public/Admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="./Public/Admin/assets/crossbrowserjs/html5shiv.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/respond.min.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="./Public/Admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="./Public/Admin/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="./Public/Admin/assets/plugins/DataTables/js/dataTables.colVis.js"></script>
<script src="./Public/Admin/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>
		$(document).ready(function() {
			App.init();
                        loads();
                        $("form").submit(function() {return false();});
		});
                
                function loads(){
                    $.getJSON("index.php?m=Admin&c=Models&a=model_pid",function(result){
                        var html='<option value="0">顶级模块</option>';
                        if(result!=null){
                            $.each(result, function(key, val) {
                                html+='<option value="'+val.id+'">'+val.name+'</option>';
                            });
                            
                        }
                        $("#cd_id").html(html);
                    });
                    
                }
                function fromes(){
                    $.getJSON('index.php?m=Admin&c=Models&a=doadd&name='+$("#name").val()+'&controller='+$("#controller").val()+'&function='+$("#function").val()+'&cd_id='+$("#cd_id").val()+'&ico='+$("#ico").val()+'&is_cd='+$("#is_cd").val(),function(result){
                        if(result==1){
                            window.location="index.php?m=Admin&c=Models&a=lists";
                        }
                    });
                }
	</script>


</body>
</html>

